class Manager::UsersBm::QueryUsersController < Admin::WmsApplicationController
  before_action :set_user, only: [:show]

  def index
    #查询全部用户
    authorize! :query_users, Admin::User
    @users = Admin::User.all
  end

  def show
    authorize! :query_bm_user, Admin::User
    #查询当前此用户下的博客
    @posts= Post.where(admin_user_id: @user)
    #转至后台用户详情页面
  end


  private
  def set_user
    @user= Admin::User.find(params[:id])
  end
end
